<!doctype html>
<html>
<head>
    {include file="index/head" /}
</head>
<body>
{include file="index/header" /}
<div class="main">
    <div id="step"></div>
    <div class="install" id="log">
      <ul id="loginner">
      </ul>
    </div>
    <div class="center"> <a href="javascript:;" class="a-btn"><div class="bottom tac"><img src="/static/install/images/loading.gif" align="absmiddle" />&nbsp;正在安装...</div></a> </div>
</div>
{include file="index/footer" />}
  <script type="text/javascript">
    var n=0;
    var data = {:html_entity_decode($data)};
    var $step = $("#step");
    $step.step({
      index: 3,
      time: 500,
      title: ["使用协议", "检查环境", "配置系统", "安装数据库", "完成安装"]
    });
    $.ajaxSetup ({ cache: false });
    function reloads(n) {
        var url =  "{:url('/Index/mysql')}?n="+n;
        $.ajax({
            type: "POST",
            url: url,
            data: data,
            dataType: 'json',
            beforeSend:function(){
            },
            success: function(msg){
                if(msg.n=='999999'){
                    $('#dosubmit').attr("disabled",false);
                    $('#dosubmit').removeAttr("disabled");
                    $('#dosubmit').removeClass("nonext");
                    setTimeout(gonext(msg.a),2000);
                }

                if(msg.n){
                    $('#loginner').append(msg.msg);
                    reloads(msg.n);
                }else{
                    alert(msg.msg);
                }
            }
        });
    }
    function gonext(a){
        window.location.href="{:url('/Index/step_5')}"+"?a="+a;
    }
    $(document).ready(function(){
        reloads(n);
    })
</script>
</body>
</html>